class Store {

    get(key) {
      let value = sessionStorage.getItem(key) || ''
      if (/^(\[|\{])/.test(value)) {
        value = JSON.parse(value)
      }
      return value
    }
  
    set(key, value) {
      if (typeof value === 'object') {
        value = JSON.stringify(value)
      }
      sessionStorage.setItem(key, value)
    }
  
    remove(key) {
      sessionStorage.removeItem(key)
    }
  }
  
  export default new Store;